<?php
	$form = $this->form;
	$form->prepare();
	$form->setAttribute('action', $this->url('admin', array('action' => 'newteacher')));
	$form->get('submit')->setAttribute('class', 'btn btn-success');

	$labelUsername	= $this->formLabel($form->get('username'));
	$username	= $this->formInput($form->get('username'));
	$errorUsername	= $this->formElementErrors($form->get('username'));

	$labelPassword	= $this->formLabel($form->get('password'));
	$password	= $this->formInput($form->get('password'));
	$errorPassword	= $this->formElementErrors($form->get('password'));

	$labelPassword_	= $this->formLabel($form->get('re_password'));
	$password_	= $this->formInput($form->get('re_password'));
	$errorPassword_	= $this->formElementErrors($form->get('re_password'));

	$labelYourname	= $this->formLabel($form->get('yourname'));
	$yourname	= $this->formInput($form->get('yourname'));
	$errorYourname	= $this->formElementErrors($form->get('yourname'));

	$labelBirthday	= $this->formLabel($form->get('birthday'));
	$birthday	= $this->formInput($form->get('birthday'));

	$submit 	= $this->formInput($form->get('submit'));

	echo $this->form()->openTag($this->form);
?>
	<h2 class="sub-header" style="font-weight: bold;">Tạo tài khoản giáo viên</h2>
	<div class="form-group">
		<h4><?php echo $labelUsername; ?></h4>
		<div class="text-danger">
			<?php echo $errorUsername;?>
			<?php if ($this->err != "") echo "<ul><li>".$this->err."</li></ul>";?>
		</div>
		<?php echo $username; ?>
	</div>
	<div class="form-group">
		<h4><?php echo $labelPassword; ?></h4>
		<div class="text-danger"><?php echo $errorPassword; ?></div>
		<?php echo $password; ?>
	</div>
	<div class="form-group">
		<h4><?php echo $labelPassword_; ?></h4>
		<div class="text-danger"><?php echo $errorPassword_; ?></div>
		<?php echo $password_; ?>
	</div>
	<div class="form-group">
		<h4><?php echo $labelYourname; ?></h4>
		<div class="text-danger"><?php echo $errorYourname; ?></div>
		<?php echo $yourname; ?>
	</div>
	<div class="form-group">
		<h4><?php echo $labelBirthday; ?></h4>
		<?php echo $birthday; ?>
	</div>
	<?php echo $this->formHidden($form->get('csrf'));?>
	<br>
	<p align="center"><?php echo $submit?></p>
<?php
	echo $this->form()->closeTag($form);
?>

<style>
.ui-datepicker-title select{
	color: black;
}
</style>
<script src="<?php echo $this->basePath();?>/jqueryCalendar/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="<?php echo $this->basePath();?>/jqueryCalendar/jquery-ui-1.8.15.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$('#datepicker').datepicker({
			changeMonth: true,
			changeYear: true,
			yearRange: '-100:+0',
			dateFormat: 'dd-mm-yy',
		}).val();
	});
</script>